package wechat.rcv.controller;

import com.google.common.base.Objects;
import com.shrcl.engineerprocess.domain.CorpWeChatUserDAO;
import edu.fudan.mylang.pf.IObjectFactory;
import org.apache.log4j.Logger;
import org.eclipse.xtext.xbase.lib.Exceptions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import wechat.rcv.RcvToken;
import weixin.mp.aes.WXBizMsgCrypt;

@Controller
@Transactional
@SuppressWarnings("all")
public class GetMyList {
  private final static Logger logger = Logger.getLogger(GetMyList.class.getName());
  
  @Autowired
  private IObjectFactory entities;
  
  @Autowired
  private CorpWeChatUserDAO corpWeChatUserDAO;
  
  @RequestMapping("/mylist")
  public String process(@RequestParam(value = "d2387fdefg3782", defaultValue = "") final String wechatid_rypt, @RequestParam(value = "dh28rfr43gh", defaultValue = "") final String state, final Model model) {
    try {
      String _xblockexpression = null;
      {
        GetMyList.logger.info("=========>GetMyList.processs<============");
        GetMyList.logger.info(("=========>GetMyList.wechatid_rypt<============" + wechatid_rypt));
        String hpage = "error";
        WXBizMsgCrypt _wxcpt = RcvToken.getWxcpt();
        String wechatid = _wxcpt.decrypt(wechatid_rypt);
        GetMyList.logger.info(("=========>GetMyList.wechatid<============" + wechatid));
        GetMyList.logger.info(("=========>GetMyList.state<============" + state));
        model.addAttribute("wechatid", wechatid);
        String _xifexpression = null;
        boolean _equals = Objects.equal(state, "101");
        if (_equals) {
          _xifexpression = hpage = "mynotification";
        } else {
          String _xifexpression_1 = null;
          boolean _equals_1 = Objects.equal(state, "100");
          if (_equals_1) {
            _xifexpression_1 = hpage = "myworkorder";
          }
          _xifexpression = _xifexpression_1;
        }
        _xblockexpression = _xifexpression;
      }
      return _xblockexpression;
    } catch (Throwable _e) {
      throw Exceptions.sneakyThrow(_e);
    }
  }
}
